//   Copyright 2012,2013 Vaughn Vernon
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.

package com.saasovation.agilepm.domain.model.product;

import java.util.Collection;

import com.saasovation.agilepm.domain.model.tenant.TenantId;

/**
 * 产品存储库
 * @author learn
 */
public interface ProductRepository {

    /**
     * 获取全部租户产品
     * @param aTenantId                 租户ID
     * @return                          返回集合
     */
    public Collection<Product> allProductsOfTenant(TenantId aTenantId);

    /**
     * 下一个身份
     * @return                          返回产品ID
     */
    public ProductId nextIdentity();

    /**
     * 讨论发起ID的产品
     * @param aTenantId                 租户ID
     * @param aDiscussionInitiationId   讨论发起ID
     * @return                          返回产品
     */
    public Product productOfDiscussionInitiationId(TenantId aTenantId, String aDiscussionInitiationId);

    /**
     * 身份的产品
     * @param aTenantId                 租户ID
     * @param aProductId                产品ID
     * @return                          返回产品
     */
    public Product productOfId(TenantId aTenantId, ProductId aProductId);

    /**
     * 移除（产品）
     * @param aProduct                  产品
     */
    public void remove(Product aProduct);

    /**
     * 移除所有（产品清单）
     * @param aProductCollection        产品清单
     */
    public void removeAll(Collection<Product> aProductCollection);

    /**
     * 保存（产品）
     * @param aProduct                  产品
     */
    public void save(Product aProduct);

    /**
     * 保存所有（产品清单）
     * @param aProductCollection        产品清单
     */
    public void saveAll(Collection<Product> aProductCollection);
}
